A mechanical switch may be used to turn on a light, or to take some other electrical power action, in response to a physical state (e.g., a position) of an object. For example, a typical automobile uses a mechanical switch to sense an open door, and in response to closure of the mechanical switch, a light inside the automobile is turned on. Mechanical switches tend to be expensive. Mechanical switches may be subject to wear and corrosion and the mechanical switches may also fail.